//
// Decompiled by Jadx - 474ms
//
package ed;

import java.io.IOException;
import java.io.InputStream;
import okhttp3.ad;
import okhttp3.v;
import z.h;
import z.p;
import z.q;

public final class c extends ad {
    public final v a;
    public final InputStream b;

    public c(v vVar, InputStream inputStream) {
        this.a = vVar;
        this.b = inputStream;
    }

    public final long contentLength() {
        try {
            return this.b.available();
        } catch (IOException unused) {
            return 0L;
        }
    }

    public final v contentType() {
        return this.a;
    }

    public final void writeTo(h hVar) throws IOException {
        p pVar = null;
        try {
            pVar = q.h(this.b);
            hVar.g(pVar);
        } finally {
            l.c.k(pVar);
        }
    }
}
